<?php 
   /* var $this ArticlesController
      var $model Articles
   */
   $this->breadcrumbs = array(
      'Quản lý bài viết' => '/index.php/admin/articles',
      'Cập nhật bài viết',
   );
?>

<div class="form" id="<?php echo Yii::app()->controller->id . '-' . Yii::app()->controller->action->id?>">
   <?php
      $form = $this->beginWidget('CActiveForm',array(
         'enableClientValidation' => true,
         'clientOptions' => array(
            'validateOnSubmit' => true,
         ),
         'id' => $this->id . '_' . $this->action->id,
         'htmlOptions' => array('enctype' => 'multipart/form-data'),
      ));?>
      
      <p class="note">Những dòng đánh dấu <span class="required">*</span> là bắt buộc.</p>

   	<?php echo $form->errorSummary($model,'Kiểm tra lại các giá trị bạn vừa nhập vào'); 
         if($message != ''){
            echo CHtml::tag('div', array('class'=>'message-success'),$message);
         }
      ?>
      <input name="session_user" type="hidden" value="<?php echo $session_user?>"/>
   <input name="action_user" type="hidden" value="" id="action_user" />
   <table>
      <tr>
         <td style="width: 150px;"><?php echo $form->labelEx($model, 'art_cat_id');?></td>
         <td><?php echo $form->dropDownList($model, 'art_cat_id',$list_cate);?></td>
      </tr>
      <tr>
         <td style="width: 150px;"><?php echo $form->labelEx($model, 'art_title');?></td>
         <td><?php echo $form->textField($model, 'art_title',array('style' =>'width:350px;' ));?></td>
      </tr>
      <tr>
         <td style="width: 150px;"><?php echo $form->labelEx($model, 'art_image');?></td>
         <td>
            <?php echo $form->fileField($model,'art_image')?>
         </td>
      </tr> 
      <tr>
         <td style="width: 150px;"><?php echo $form->labelEx($model, 'art_content');?></td>
         <td>
            <?php echo $form->textArea($model,'art_content',array('style' => 'resize: none;',
                                                                  ))?>
         </td>
      </tr> 
      <tr>
         <td style="width: 150px;"><?php echo $form->labelEx($model, 'IsActive');?></td>
         <td><?php echo $form->checkBox($model, 'IsActive',array('checked' => 'checked'));?></td>
      </tr>
      <tr>
      </tr>
   </table>
      <?php 
      $this->endWidget();
   ?>
</div>
<script>
   $(document).ready( function() {
      CKEDITOR.replace('Articles_art_content',{
         enterMode: CKEDITOR.ENTER_BR,
      });
   } );
</script>